<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <%@ include file="/WEB-INF/include/commoncss.jsp"%>
    <script type="text/javascript"
            src="${ctx}/javascript/laydate/laydate.js"></script>
</head>
<body>
<article class="page-container">
    <div action="" class="form form-horizontal" id="scheduleAdd">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>中文国名：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input id="nation_z" name="nation_z" value="${nature.nation_z}" class="input-text" disabled/>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">统计报表：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input placeholder="用逗号隔开" type="text" name="statistics" id="statistics" class="input-text" value="${nature.statistics}"/>
            </div>
            <label class="form-label col-xs-4 col-sm-2">相关文献：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input placeholder="用逗号隔开" type="text" name="conferences" id="conferences" class="input-text" value="${nature.conferences}"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">地理环境：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <textarea id="geography" name="geography" value="11" cols="130" rows="5" >${nature.geography}</textarea>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">气候：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <textarea id="climate" name="climate" value="" cols="130" rows="5" >${nature.climate}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">矿产资源：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="mineral_resource" name="mineral_resource" cols="130" rows="5" value=""  >${nature.mineral_resource}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">生物资源：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="biological_resource" name="biological_resource" cols="130" rows="5" value="" >${nature.biological_resource}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">能源资源：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="energy_resource" name="energy_resource" cols="130" rows="5" value="" >${nature.energy_resource}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">
                <span class="c-red">*</span>来源：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="reference" name="reference" cols="130" rows="5" value="" >${nature.reference}</textarea>
            </div>

        </div>
        <div class="row cl">
            <div class="col-xs-8  col-xs-offset-5 ">
                <button value="${nature.country_code}" type="button" class="btn btn-success radius" onClick="update_nature(this.value)">提交</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button id="close" value="${nature.recoder_id}" onClick="layer_close();" class="btn btn-default radius" type="button"> 关闭</button>
            </div>
        </div>
    </div>
    <%@ include file="/WEB-INF/include/commonjs.jsp"%>
    <script>
        function update_nature(value){
            var recorder=document.getElementById("close").value;
            var YHZH=parent.parent.document.getElementById("YHZH").innerText;
            if(YHZH.substring(0,3)!='001'&&YHZH.substring(0,3)!=recorder){
                layer.msg("你不能修改不是别人的内容只能查看",{icon:2,time:2000});
                return;
            }
            var conferences=document.getElementById("conferences").value;
            var statistics=document.getElementById("statistics").value;
            var geography=document.getElementById("geography").value;
            var climate=document.getElementById("climate").value;
            var mineral_resource=document.getElementById("mineral_resource").value;
            var biological_resource=document.getElementById("biological_resource").value;
            var energy_resource=document.getElementById("energy_resource").value;
            var reference=document.getElementById("reference").value;
            if(reference==null||reference==""){
                layer.msg("*为必填项",{icon:2,time:2000});
                return;
            }
            layer.confirm("确认提交吗",{btn:['确定','取消']},function(){

                var url="${ctx}/Nature/nature_update.do";
                var parameter={statistics:statistics,conferences:conferences,geography:geography,climate:climate,mineral_resource:mineral_resource,
                    biological_resource:biological_resource,energy_resource:energy_resource,country_code:value
                    ,reference:reference };
                $.post(url,parameter,function(data){
                    if(data=="修改成功"){
                        layer.msg(data,{icon:1,time:2000},function(){
                            parent.location.reload(true);
                        })
                    }else{
                        layer.msg(data,{icon:2,time:2000});
                    }
                })
            })
        }

    </script>
</article>


</body>

</html>